import { atom } from "recoil";

const user: string = "api/user";

export interface IState {
    [key: string]: number|string|boolean
}

export interface XinyuanState {
    isType: number // 用户身份类型 0：匿名，1：身份证，2：营业执照，3：户口簿，4：港澳台居住证，5外国人永久居留身份证，6：护照
    title: string // 心愿单标题
    content: string // 心愿单内容
    id?: string
    versionId?: string
    userInfo?: IState
}

export interface XuqiuState {
    [key: string]: string|number|string[]|number[]|XuqiuState
}

export const xinyuanProvider = atom<XinyuanState>({
    key: "XinyuanState",
    default: {
        isType: 0,
        title: "",
        content: ""
    }
})

export const qFormProvicer = atom<XuqiuState>({
    key: "xuqiuState",
    default: {}
})
